<include file="/public/header" />
<style>
    .layui-table-cell {
        overflow: visible;
        text-overflow: inherit;
        white-space: normal;
        height: auto;
        /*在这里设置行高没用*/
    }
</style>
<div class="layui-fluid">
    <div class="layui-card">
        <!-- // 默认操作按钮 -->
        <div class="layui-card-header layadmin-card-header-auto ">
            <div class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-input-inline " style="width: 350px;">
                            <input type="text" name="title" class="layui-input" placeholder="开始时间 至 结束时间" lay-datetime=""
                                data-range="~" data-datetype="datetime" data-dateformat="yyyy-MM-dd HH:mm:ss">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <!-- // 默认搜索 -->
                        <button class="layui-btn icon-btn" lay-filter="formSearch" lay-submit><i
                                class="layui-icon layui-icon-search"></i>{:__('搜索')}</button>
                        <!-- // 打开添加页面 -->
                        <button class="layui-btn icon-btn" lay-open="" data-title="{:__('添加')}{:__('订单')}"
                            data-url="#editforms" data-area="45%,auto">
                            <i class="layui-icon layui-icon-add-1"></i>{:__('添加')}
                        </button>
                        <div class="layui-divider layui-divider-vertical"></div>
                    </div>
                </div>
            </div>
        </div>

        <!-- // 创建数据实例 -->
        <table id="lay-tableList" lay-filter="lay-tableList"></table>
    </div>
</div>
<!-- // 添加编辑数据 -->
<script type="text/html" id="editforms">
    <div class="layui-fluid layui-bg-white" >
        <form class="layui-form layui-form-fixed" lay-filter="editforms">
        <input type="text" name="id" hidden="">
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('订单号')}</label>
            <div class="layui-input-block">
                <input name="ordersn" value="{:date('Ymd')}" data-dateformat="yyyyMMdd" lay-datetime="" data-datetype="date" placeholder="{:__('请输入交货日期')}" type="text" class="layui-input"  lay-verify="required" />
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('客户名称')}</label>
            <div class="layui-input-block">
                <input name="custom" value="五彩石长沙仓" placeholder="{:__('请输入客户名称')}" type="text" class="layui-input"  lay-verify="required" />
            </div>
        </div>  
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('生产班组')}</label>
            <div class="layui-input-block">
                <input name="team" value="五彩石生产部" placeholder="{:__('请输入生产班组')}" type="text" class="layui-input"  lay-verify="required" />
            </div>
        </div>  
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('接单人')}</label>
            <div class="layui-input-block">
                <input name="receiver" placeholder="{:__('请输入接单人')}" type="text" class="layui-input"  lay-verify="required" />
            </div>
        </div>  
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('交货日期')}</label>
            <div class="layui-input-block">
                <input name="deliveday"  value="{:date('Y-m-d',time()+86400)}" data-dateformat="yyyy-MM-dd" lay-datetime="" data-datetype="date" placeholder="{:__('请输入交货日期')}" type="text" class="layui-input"  lay-verify="required" />
            </div>
        </div>  
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('下单人')}</label>
            <div class="layui-input-block">
                <input name="placer" placeholder="{:__('请输入下单人')}" type="text" class="layui-input" />
            </div>
        </div> 
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('审核人')}</label>
            <div class="layui-input-block">
                <input name="reviewer" placeholder="{:__('请输入审核人')}" type="text" class="layui-input" />
            </div>
        </div> 
        <div class="layui-footer layui-form-item layui-center "  >
            <button class="layui-btn layui-btn-primary" type="button" sa-event="closePageDialog" >{:__('取消')}</button>
            <button class="layui-btn" lay-add="{:url('/system/morder/add')}" lay-filter="submitPage" lay-submit>{:__('提交')}</button>
        </div>              
        </form>
    </div>
    </script>
<!-- // 列表工具栏 -->
<script type="text/html" id="tableBar">
    <a class="layui-table-text" data-title="{:__('编辑')} {{d.title}}" 
        data-area="100%,100%" data-url="{:url('/system/morder/edit')}?id={{d.id}}"  lay-event="edit" >{:__('编辑')}</a>
    <div class="layui-divider layui-divider-vertical"></div>
    <a class="layui-table-text" data-title="{:__('查看')} {{d.title}}" 
    data-area="100%,100%" data-url="{:url('/system/morder/edit')}?id={{d.id}}&looks=1"  lay-event="edit" >{:__('查看')}</a>
</script>
<include file="/public/footer" />
<script>
    layui.use(['admin', 'layedit', 'table', 'form', 'content'], function () {
        var admin = layui.admin;
        var table = layui.table;
        var form = layui.form;
        /*
         * 初始化表格
        */
        var isTable = table.render({
            elem: "#lay-tableList"
            , url: "{:url('/system/morder/index')}"
            , page: true
            , limit: 18
            , toolbar: 'true'
            , cols: [[
                { type: 'checkbox', width: 50 },
                { field: 'id', align: 'center', sort: true, width: 80, title: 'ID' },
                { field: 'ordersn', align: 'left', title: '{:__("订单ID")}' },
                { field: 'custom', align: 'left', title: '{:__("客户名称")}' },
                { field: 'team', align: 'left', title: '{:__("生产班组")}' },
                { field: 'receiver', align: 'left', title: '{:__("接单人")}' },
                { field: 'deliveday', align: 'left', title: '{:__("交货日期")}' },
                { field: 'placer', align: 'left', title: '{:__("下单人")}' },
                { field: 'reviewer', align: 'left', title: '{:__("审核人")}' },
                { field: 'create_time', align: 'center', width: 180, title: '{:__("添加时间")}' },
                { align: 'center', toolbar: '#tableBar', width: 160, title: '{:__("操作")}' },
            ]],
            done: function () {
                //当数据渲染完后，执行的回调
            }
        })
    })
</script>